package com.mingqijia.gassafety.shared.constant;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.springframework.util.CollectionUtils;

import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;


/**
 * @author zhangfei
 * @version 1.0.0
 * @ClassName ExportListCode.java
 * @Description TODO
 * @createTime 2023年09月28日
 */
@Getter
@RequiredArgsConstructor
public enum ExportListCode {

//    LIST_CODE_1("EXPORT0001","CUSTOMER_LIST","客户列表"),
//    LIST_CODE_2("EXPORT0002","TEAL_TIME_MONITORING","实时监测"),
//    LIST_CODE_3("EXPORT0003","ALARM_RECORD","报警记录"),
//    LIST_CODE_4("EXPORT0008","HZ_ALARM_RECORD","杭州报警记录"),
//    LIST_CODE_5("EXPORT0004","BREAKDOWN_RECORD","故障记录"),
//    LIST_CODE_6("EXPORT0009","HZ_BREAKDOWN_RECORD","杭州故障记录"),
    LIST_CODE_7("EXPORT0005","EQUIPMENT_LIST","设备列表"),
    OTHER("","","");

    private final String code;
    private final String value;
    private final String alias;
    public static ExportListCode parse(String code) {
        List<ExportListCode> filtered = Arrays.stream(ExportListCode.values())
                .filter(item ->
                        Objects.equals(item.getCode(), code))
                .collect(Collectors.toList());
        return CollectionUtils.isEmpty( filtered ) ? OTHER : filtered.get(0);
    }

}
